using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using NHibernate.Mapping.ByCode.Conformist;
using NHibernate.Mapping.ByCode;
using Domain.Model.Entity;


namespace Domain.Model.Map
{
    public class OZUserMap : ClassMapping<OZUser>
    {

        public OZUserMap()
        {
            Table("OZ_User");
            Schema("dbo");
            Lazy(true);
            Id(x => x.UserID, map => { map.Column("User_ID"); map.Generator(Generators.Assigned); });
            Property(x => x.UserCode, map => map.Column("User_Code"));
            Property(x => x.UserLoginName, map => map.Column("User_LoginName"));
            Property(x => x.UserRealName, map => map.Column("User_RealName"));
            Property(x => x.UserPassword, map => map.Column("User_Password"));
            Property(x => x.UserEmail, map => map.Column("User_Email"));
            Property(x => x.UserMobile, map => map.Column("User_Mobile"));
            Property(x => x.UserCreateDate, map => map.Column("User_CreateDate"));
            Property(x => x.UserStatus, map => map.Column("User_Status"));
            Bag(x => x.OZUserDetail, colmap => { colmap.Key(x => x.Column("User_ID")); colmap.Inverse(false); colmap.Lazy(CollectionLazy.Lazy); }, map => { map.OneToMany(); });
        }
    }
}
